<template>
    <div class="homeform-container">


        <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
            <el-tab-pane label="供应商基础信息" name="first">
                <Basics />
            </el-tab-pane>
            <el-tab-pane v-if="_Id" label="质量协议" name="second">
                <Quality />
            </el-tab-pane>
            <el-tab-pane  v-if="_Id" label="ROSH协议" name="rosh">
                <Rosh />
            </el-tab-pane>
            <el-tab-pane  v-if="_Id" label="质量目标" name="fourth1">
                <QualityObjectives />
            </el-tab-pane>
            <el-tab-pane  v-if="_Id" label="审核计划" name="fourth2">
              <Examine />
            </el-tab-pane>
            <!-- <el-tab-pane  v-if="_Id" label="审核问题" name="fourt3">
               <AuditIssues/>
            </el-tab-pane> -->
        </el-tabs>


    </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'

import P_store from "@store/supplierpro/index.js"
import { storeToRefs, defineStore } from "pinia"
import Basics from './components/Basics.vue'
import Quality from './components/Quality.vue'
import Rosh from './components/Rosh.vue'
import Examine from './components/Examine.vue'
import QualityObjectives from './components/QualityObjectives.vue'
import AuditIssues from './components/AuditIssues.vue'
const P = P_store()
const _G = defineStore('main', {})()
const {activeName} = storeToRefs(P)
const _Id = ref(_G.M.GetId())

onMounted(async () => {
    if (_Id.value) {
        await P.Hp_GetIdSee(_Id.value)
    }else{
        P.$state.P_Form = {}
    }
})


const handleClick = (tab) => {
    console.log(tab)
}
</script>

<style lang="less" scoped>
.homeform-container {
    padding: 0 24px 12px 24px;
    background-color: #fff;
    border-radius: 4px;
    height: calc(100vh - 72px);
}
</style>